using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BanHangCshap.Class;
namespace BanHangCshap.BaoCaoTongHop
{
    public partial class frmTongKetHangBan : DevExpress.XtraEditors.XtraForm
    {
        PhieuNhapXuat cls = new PhieuNhapXuat();
        public frmTongKetHangBan()
        {
            InitializeComponent();
        }
        //public void loadDSHangHoa()
        //{
        //    string sql = "select mahang, mahang + ' - ' + tenhang as hanghoa from HangHoa";
        //    DataTable dt = cls.getDataTable(sql);
        //    DataRow dr = dt.NewRow();
        //    dr[0] = dr[1] = "";
        //    dt.Rows.InsertAt(dr, 0);
        //    glkuHangHoa.Properties.DataSource = dt;
        //    glkuHangHoa.Properties.ValueMember = "mahang";
        //    glkuHangHoa.Properties.DisplayMember = "hanghoa";
        //    glkuHangHoa.EditValue = "";
        //}
        private void glkuHangHoa1_Properties_KeyPress(object sender, KeyPressEventArgs e)
        {

        }

        private void glkuHangHoa_Properties_KeyPress(object sender, KeyPressEventArgs e)
        {

        }

        private void btnXem_Click(object sender, EventArgs e)
        {
            //string sql = "";
            //if (chkXemChiTiet.Checked)
            //{
            //    sql = "select distinct a.mahang, tenhang,c.dvt, slnhapxuat as soluong,  dgnhapxuat as dongia, chietkhau, thanhtien,  a.manhapxuat + '/' + sohd as sochungtu,  ngaynhapxuat as ngaylap, sort1, stt ";
            //    sql += "from PhieuNhapXuatCT a left join PhieuNhapXuat b on a.manhapxuat = b.manhapxuat ";
            //    sql += "left join HangHoa c on a.mahang = c.mahang where ngaynhapxuat >= convert(datetime,'" + ((DateTime)dateTuNgay.EditValue).ToString("dd/MM/yyyy") + "',103) and  ngaynhapxuat <= convert(datetime,'" + ((DateTime)dateDenNgay.EditValue).ToString("dd/MM/yyyy") + "',103) ";
            //    if (glkuHangHoa.EditValue.ToString().Trim().Length > 0)
            //        sql += "and a.mahang = '" + glkuHangHoa.EditValue.ToString().Trim() + "'";
            //    sql += " order by a.mahang,sort1, stt";
            //}
            //grcTongHopHangBan.DataSource = cls.getDataTable(sql);
            //grvTongHopHangBan.BestFitColumns();
        }

        private void frmTongKetHangBan_Load(object sender, EventArgs e)
        {
            //dateTuNgay.EditValue = UltitityStatic.layNgayDauThang();
            //dateDenNgay.EditValue = DateTime.Now;
            //loadDSHangHoa();
        }

        private void ctrlTongKetHangBanChung1_Load(object sender, EventArgs e)
        {

        }
    }
}